package com.zonda.sampleretrofit2.model;


import android.text.TextUtils;
import android.util.JsonReader;

import java.io.IOException;

public class NewsMediaModel extends AppBasicObject{

  private String gifUrl;

  private String minUrl;

  private String mUrl;

  @Override
  public boolean convertFrom(JsonReader jsonReader) throws IOException {

    super.convertFrom(jsonReader);

    jsonReader.beginObject();
    while (jsonReader.hasNext()){
      final String name = jsonReader.nextName();
      if(TextUtils.equals(name,"gif_url")){
        gifUrl = jsonReader.nextString();
      }else if(TextUtils.equals(name,"min_url")){
        minUrl = jsonReader.nextString();
      }else if(TextUtils.equals(name,"m_url")){
        mUrl = jsonReader.nextString();
      }else {
        jsonReader.skipValue();
      }
    }
    jsonReader.endObject();

    return true;
  }

  public String getGifUrl() {
    return gifUrl;
  }

  public void setGifUrl(String gifUrl) {
    this.gifUrl = gifUrl;
  }

  public String getMinUrl() {
    return minUrl;
  }

  public void setMinUrl(String minUrl) {
    this.minUrl = minUrl;
  }

  public String getmUrl() {
    return mUrl;
  }

  public void setmUrl(String mUrl) {
    this.mUrl = mUrl;
  }
}
